//
//  HomePageRequestTools.m
//  JinFuThree
//
//  Created by 爱尚 on 2018/10/18.
//  Copyright © 2018年 毛韶谦. All rights reserved.
//

#import "HomePageRequestTools.h"

@implementation HomePageRequestTools

/**
 借*贷列表数据
 keyword = 1 返回推荐产品，keyword = 0 返回非推荐产品，不传，返回混合的。
 @param parameters 参数
 @param success 成功返回
 @param failure 失败返回
 */
+ (void)LoanProductListDataWithParameters:(NSDictionary *)parameters  Success:(nonnull void (^)(_Nullable id responseObject))success Failure:(nonnull void(^)(_Nullable id responseObject,  NSError * _Nullable error))failure{
    
    NSString *url = [Common ServicesURL:@"/as/app/financial/home/loanSupermarketProduct"];
    [[RequestManager manager] HFQDataRequest_Mao:RequestMethodGet URLString:url parameters:parameters success:^(id  _Nullable responseObject) {
        
        NSDictionary *dataDic = responseObject;
        if ([[NSString stringWithFormat:@"%@",dataDic[@"code"]] isEqualToString:@"200"]) {
            success(responseObject);
        }else {
            failure(responseObject, nil);
        }
    } failure:^(id  _Nullable responseObject, NSError * _Nullable error) {
        
        failure(responseObject, error);
    }];
    
}
@end
